"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.RoomJinbiConfig = void 0;
const RoomModel_1 = require("../../hall_server/model/RoomModel");
const GameConfig_1 = require("./GameConfig");
const RoomConfig_1 = require("./RoomConfig");
class RoomJinbiConfig {
    constructor(level, difen, enterMin, serve, minCharge = 0) {
        this.level = 1; //场次
        this.difen = 0; //底分
        this.enterMin = 0; //入场最低携带
        this.serve = 0; //服务费
        this.minCharge = 0; //最低多少金币
        this.online = 0; //在线
        this.level = level;
        this.difen = difen;
        this.enterMin = enterMin;
        this.serve = serve;
        this.minCharge = minCharge;
    }
    static init() {
        return __awaiter(this, void 0, void 0, function* () {
        });
    }
    static getConfigListByGame(gameType) {
        let resultList = [];
        for (let i = 0; i < this.jinbiConfigList.length; i++) {
            let config = this.jinbiConfigList[i];
            // if (config.gameType == gameType) {
            config.online = RoomModel_1.RoomModel.getRoomOnlineNumByGameType(RoomConfig_1.RoomConfig.Room_Type.Jinbi, gameType, config.level);
            resultList.push(config);
            // }
        }
        return resultList;
    }
    static getPaodekuaiConfigList() {
        for (let i = 0; i < this.paodekuai_jinbichangList.length; i++) {
            let config = this.paodekuai_jinbichangList[i];
            config.online = RoomModel_1.RoomModel.getRoomOnlineNumByGameType(RoomConfig_1.RoomConfig.Room_Type.Jinbi_Special, GameConfig_1.GameConfig.Game_Type.paodekuai, config.level);
        }
        return this.paodekuai_jinbichangList;
    }
    static getZiyouchangList() {
        for (let i = 0; i < this.ziyouchang_list.length; i++) {
            let config = this.ziyouchang_list[i];
            config.online = RoomModel_1.RoomModel.getRoomOnlineByRoomType(RoomConfig_1.RoomConfig.Room_Type.Ziyou, config.level);
        }
        return this.ziyouchang_list;
    }
    static getConfigByGameAndLevel(gameType, roomType, level) {
        let configList = [];
        if (roomType == RoomConfig_1.RoomConfig.Room_Type.Jinbi) {
            configList = this.jinbiConfigList;
        }
        else if (roomType == RoomConfig_1.RoomConfig.Room_Type.Jinbi_Special) {
            configList = this.paodekuai_jinbichangList;
        }
        else if (roomType == RoomConfig_1.RoomConfig.Room_Type.Ziyou) {
            configList = this.ziyouchang_list;
        }
        for (let i = 0; i < configList.length; i++) {
            let config = configList[i];
            if (config.level == level) {
                return config;
            }
        }
    }
}
exports.RoomJinbiConfig = RoomJinbiConfig;
RoomJinbiConfig.jinbiConfigList = [];
RoomJinbiConfig.paodekuai_jinbichangList = [];
RoomJinbiConfig.ziyouchang_list = [];
